package com.zyz.A_程序基础.D_字符串;

/**
 * @author: vick
 * @Date: 2025/3/10
 * @Description:
 * @version: 1.0
 */
public class Demo2 {
    public static void main(String[] args) {
        String s1 = "hello";
        String s2 = "world";
        String result = s1 + " " + s2;
        System.out.println(result);

        //如果用+连接字符串和其他数据类型，会将其他的数据类型自动转成字符串，再连接：
        int age = 18;
        String result2 = "age is " + age;
        System.out.println(result2);
    }
}
